import request from '@/utils/request'


export default {
    //课程列表 条件查询带分页
    getListPage(page,size,params){
        return request({
            url: `/cmsservice/courses/pageCourses/${page}/${size}`,
            method: 'post', 
            params
          })
    },
    //根据id删除课程
    removeById(id) {
        return request({
        url: `/cmsservice/courses/removeCourses/${id}`,
        method: 'post'
         })
    },
    //添加课程
    addInfo(data){
        return request({
            url: `/cmsservice/courses/addCourses`,
            method: 'post',
            data
        })
    },
    //修改课程
    updateInfo(data){
        return request({
            url: `/cmsservice/courses/updateCourses`,
            method: 'post',
            data          
        }) 
    },
    //id查询数据回显
    getInfoById(id){
        return request({
            url: `/cmsservice/courses/getCourse/${id}`,
            method: 'get'          
        })
    },
    // 获取所有课程
    findAllCourse() {
        return request({
            url: `/cmsservice/courses/findAllTeacher`,
            method: 'get'          
        })
    },

    // 获取选修课
    getElective() {
        return request({
            url: `/cmsservice/courses/getElective`,
            method: 'get'          
        })
    }
}

